import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {SfzForm} from "../vo/SfzForm";
import {Stuinfo} from "../model/Stuinfo";

@Injectable({
  providedIn: 'root'
})
export class StuinfoService {

  constructor(private http:HttpClient) { }

  private getStuinfoListUrl="http://localhost/getStuinfoEntityList";
  getStuinfoList(){


    return this.http.get(this.getStuinfoListUrl).toPromise();
  }

  private addStuinfoUrl='http://localhost/addStuinfoEntity';
  addStuinfo(sfzform:SfzForm){
    return this.http.post(this.addStuinfoUrl,sfzform).toPromise();
  }

  private deleteSuinfoUrl="http://localhost/deleteStuinfoEntity";
  deleteStuinfo(stinfo:Stuinfo){

    return this.http.post(this.deleteSuinfoUrl,stinfo).toPromise();
  }


  private getTouUpdateStuinfoUrl="http://localhost/getSingleStuinfoEntity";
 getToUpdateStuinfo(stuinfo:Stuinfo){
   return this .http.post(this.getTouUpdateStuinfoUrl,stuinfo).toPromise();
 }

private  updateStuinfoUrl="http://localhost/updateStuinfoEntity";
 updateStuinfo(sfzform:SfzForm){
   return this.http.post(this.updateStuinfoUrl,sfzform).toPromise();
 }

}
